package com.woniuxy.Test;

import java.io.InputStream;
import java.util.Properties;

/**
 * @author LinKe
 * @version 1.0
 * @date 2021/11/9 16:58
 */
public class Test{
    private static  Properties properties;

    static {
        try {
            //读取配置文件
            InputStream is = Test.class.getClassLoader().getResourceAsStream("config.properties");
            properties = new Properties();
            properties.load(is);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

    public static void main(String[] args) {
        String aaa = properties.getProperty("aaa");
        System.out.println(aaa);
    }
}
